<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <

    </div>

    <script src="../js/vue.js"></script>

    <script>
      const LkBox = {
        props:{
          total:Number
        },
        data(){
          return {
            myTotal:this.total
          }
        },
        template:`
        <div>传递的数据:{{total}}</div>
        <button @click="total++">修改1</button>
        <hr>
        <div>自己的数据:{{myTotal}}</div>
        <button @click="myTotal++"> 修改2</button>
        `,
      };
      const app = Vue.createApp({
        data() {
          return {
            count: 100,
          };
        },
        components:{
          'lk-box':LkBox
        },
        template:`
        <lk-box :total="count"></lk-box>
        `
      }).mount("#app");
    </script>
  </body>
</html>
